package com.hxd.mall.module.school.video

import com.alibaba.android.arouter.facade.annotation.Route
import com.hxd.mall.R
import com.hxd.mall.base.BaseInjectActivity
import com.hxd.mall.constant.HxdConstantsRouterPath.School.path_school_video
import com.hxd.mall.utils.local.getListAdapter
import com.hxd.mall.utils.local.getModule
import com.hxd.mall.utils.open.initRecyclerView
import kotlinx.android.synthetic.main.activity_video_list_layout.*

/**
 * 看大咖分享销售经验 更多页
 */
@Route(path = path_school_video)
class VideoActivity : BaseInjectActivity<IVideoPresenter>(), IVideoView {

    override fun attachLayoutRes(): Int = R.layout.activity_video_list_layout

    override fun initViews() {
        //setTitleCommon(getString(R.string.look_share_experience))
        initListView()
    }

    private fun initListView() {
    }

    override fun initData() {
        val moduleLayout = getModule(intent.getStringExtra("list"))
        if (moduleLayout != null) {
            val title =
                if (moduleLayout.title.isEmpty()) getString(R.string.look_share_experience) else moduleLayout.title
            setTitleCommon(title)

            videoList.initRecyclerView(getListAdapter(moduleLayout.resources, VideoAllListAdapter()), padding = 12, leftPadding = 0)
        }
    }

    override fun showData() {
    }

}
